package coop.tecso.test.objets.complex;

//src/gen
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;

/**
 *
 */
@Entity
@Table(name = "REASON_OF_ISSUANCE_FIM")
public class ReasonOfIssuanceFim implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "CODE", nullable = false)
	private String code;
	@Version
	@Column(name = "VERSION")
	private int reasonOfIssuanceFimversion;

	/**
	 *
	 */
	@Basic(optional = false)
	@Column(name = "DESCRIPTION", nullable = false, length = 255)
	private String description;

	/**
	 *
	 */
	@OneToMany(targetEntity = Fim.class, mappedBy = "reasonOfIssuance", fetch = FetchType.LAZY)
	private java.util.Set<Fim> fim = new java.util.HashSet<Fim>();

	public ReasonOfIssuanceFim() {
	}

	// Constructor for primary key
	public ReasonOfIssuanceFim(String code) {
		this.code = code;
	}

	/**
	 *
	 */
	public String getCode() {
		return code;
	}

	public int getReasonOfIssuanceFimversion() {
		return reasonOfIssuanceFimversion;
	}

	public void setReasonOfIssuanceFimversion(int reasonOfIssuanceFimversion) {
		this.reasonOfIssuanceFimversion = reasonOfIssuanceFimversion;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public java.util.Set<Fim> getFim() {
		return fim;
	}

	public void setFim(java.util.Set<Fim> fim) {
		this.fim = fim;
	}

	public void addFim(Fim fim) {
		this.fim.add(fim);
	}

	public void removeFim(Fim fim) {
		this.fim.remove(fim);
	}
}
